package com.example.springboottest.example.jaxws.hello.client;

import com.example.springboottest.example.jaxws.hello.HelloWorld;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;

public class Client2 {
    public static void main(String[] args) {
        HelloWorld service = (HelloWorld) transmit();
        System.out.println(service.sayHello("方宁"));
        System.exit(0);
    }

    public static Object transmit() {
        Object service = null;
        try {
            JaxWsProxyFactoryBean soapFactoryBean = new JaxWsProxyFactoryBean();
            soapFactoryBean.setAddress("http://localhost:9000/HelloWorld");
            soapFactoryBean.setServiceClass(HelloWorld.class);
            service = soapFactoryBean.create();
//			 configTimeout(service);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return service;
    }
}
